var e = require;
var t = module;
var o = exports;
var ii, nn = this && this.__extends || (ii = function (t, e) {
    return (ii = Object.setPrototypeOf || {
        __proto__: []
    }
        instanceof Array &&
        function (t, e) {
            t.__proto__ = e
        } ||
        function (t, e) {
            for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o])
        })(t, e)
},
    function (t, e) {
        function o() {
            this.constructor = t
        }
        ii(t, e),
            t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o)
    }
),
    rr = this && this.__awaiter ||
        function (t, e, o, i) {
            return new (o || (o = Promise))(function (n, a) {
                function r(t) {
                    try {
                        l(i.next(t))
                    } catch (e) {
                        a(e)
                    }
                }
                function s(t) {
                    try {
                        l(i.
                            throw(t))
                    } catch (e) {
                        a(e)
                    }
                }
                function l(t) {
                    var e;
                    t.done ? n(t.value) : (e = t.value, e instanceof o ? e : new o(function (t) {
                        t(e)
                    })).then(r, s)
                }
                l((i = i.apply(t, e || [])).next())
            })
        };
var oo = (this && this.__decorate) ||
    function (e, t, a, n) {
        var i,
            o = arguments.length,
            s = o < 3 ? t : null === n ? (n = Object.getOwnPropertyDescriptor(t, a)) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) s = Reflect.decorate(e, t, a, n);
        else
            for (var r = e.length - 1; r >= 0; r--)
                (i = e[r]) && (s = (o < 3 ? i(s) : o > 3 ? i(t, a, s) : i(t, a)) || s);
        return o > 3 && s && Object.defineProperty(t, a, s), s;
    }; Object.defineProperty(o, "__esModule", { value: !0 });
var a = e("AudioManager"),
    n = e("ModuleUI"),
    i = e("AD"),
    r = e("Toast"),
    s = cc._decorator,
    l = s.ccclass,
    _ = s.property,
    c = (function (e) {
        function t() {
            var t = (null !== e && e.apply(this, arguments)) || this;
            return (
                (t.talk_btn_list = []),
                (t.talk_string_editbox = null),
                (t.talk_info = ["新英雄", "新地图", "新玩法"]),
                t
            );
        }
        return (
            nn(t, e),
            (t.prototype.initView = function () {
                e.prototype.initView.call(this);
                for (var t = 0; t < this.talk_btn_list.length; t++) this.talk_btn_list[t].children[1].active = !1;
                this.talk_string_editbox.string = "";
            }),
            (t.prototype.OnClick = function (t) {
                var o = this;
                e.prototype.OnClick.call(this, t);
                var n = t.node;
                switch (n.name) {
                    case "back_btn":
                        this.closeThisPopup();
                        break;
                    case "send_btn":
                        var s = function () {
                            for (var e = 0; e < o.talk_btn_list.length; e++)
                                o.talk_btn_list[e].children[1].active && o.talk_info[e];
                            for (o.talk_string_editbox.string, e = 0; e < o.talk_btn_list.length; e++)
                                o.talk_btn_list[e].children[1].active = !1;
                            (o.talk_string_editbox.string = ""), r.default.showNewToast("发送成功");
                        };
                        i.default.getInstance().showVideo(function (e) {
                            a.default.playGameBGM(), e == i.ResultEnum.Success && s();
                        });
                        break;
                    case "talk_btn_0":
                    case "talk_btn_1":
                    case "talk_btn_2":
                        n.children[1].active = !n.children[1].active;
                }
            }),
            oo([_(cc.Node)], t.prototype, "talk_btn_list", void 0),
            oo([_(cc.EditBox)], t.prototype, "talk_string_editbox", void 0),
            oo([l], t)
        );
    })(n.default);
o.default = c;
